package com.sxygsj.android.personnelscreen.plugin_jiguang.main;

import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.viewpager2.adapter.FragmentStateAdapter;


import com.sxygsj.android.personnelscreen.plugin_jiguang.advertisement.AdvertisementFragment;
import com.sxygsj.android.personnelscreen.plugin_jiguang.userInfoList.UserInfoListFragment;

import java.util.ArrayList;
import java.util.List;

public class ViewPagerAdapter extends FragmentStateAdapter {

    List<Fragment> fragmentList=new ArrayList<>();
    public ViewPagerAdapter(@NonNull FragmentActivity fragmentActivity) {
        super(fragmentActivity);
        fragmentList.add(new UserInfoListFragment());
        fragmentList.add(new AdvertisementFragment());
    }

    @NonNull
    @Override
    public Fragment createFragment(int position) {
        return fragmentList.get(position);
    }

    @Override
    public int getItemCount() {
        return fragmentList.size();
    }
}
